package com.jingdianjichi.wx.handler;

import lombok.Getter;

/**
 * 微信接受消息类型枚举
 */
@Getter
public enum WxChatMsgTypeEnum {
    SUBSCRIBE("event.subscribe","用户关注事件"),
    TEXT_MSG("text","接受用户文本消息");
    private String msgType;
    private String desc;
    WxChatMsgTypeEnum(String msgType,String desc){
        this.desc=desc;
        this.msgType=msgType;
    }
    public static WxChatMsgTypeEnum getByMsgType(String msgType){
        for(WxChatMsgTypeEnum wxChatMsgTypeEnum:WxChatMsgTypeEnum.values()){
            if(wxChatMsgTypeEnum.getMsgType().equals(msgType)){
                return wxChatMsgTypeEnum;
            }
        }
        return null;
    }
}
